package com.gba.mark.group.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gba.mark.group.entity.Group;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface GroupMapper extends BaseMapper<Group> {

    @Select("SELECT `id` FROM `group_team` WHERE `admin_id` = #{adminId} AND `group_name` = #{groupName}")
    int selectGroupIdByAdmin(@Param("userId") int adminId, String groupName);

//    @Select("SELECT `id` FROM `group_team`" +
//            "ORDER BY RAND() ")
//    List<Integer> getGroupId();


}
